/*
 * Created: 2022-09-12 20:51:29
 * Author : 涛涛涛
 */

import React, { FC } from 'react';
import { View, Text } from '@tarojs/components';
import { styled } from 'linaria/react';
import { useClassName } from '@/utils/index';
export interface IProps extends ICompProps {}
Loading.defaultProps = {} as Partial<IProps>;
/** 加载中的状态组件 */
function Loading(props: IProps) {
    const { className, style } = props;
    const localClassName = useClassName('Loading', className);
    return (
        <RootView className={localClassName} style={style}>
            <View className="iconfont-wrap">
                <View className="iconfont">&#xe7f1;</View>
            </View>
            <View className="loading-text">加载中...</View>
        </RootView>
    );
}
export default React.memo(Loading as FC<IProps>);

const RootView = styled(View)`
    @keyframes xuan_zhuan {
        0% {
            transform: rotate(0deg);
        }
        100% {
            transform: rotate(360deg);
        }
    }
    &.Loading {
        padding: 30px;
        width: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        .iconfont-wrap {
            > .iconfont {
                font-size: 80px;
                line-height: 1;
                animation: xuan_zhuan 1s linear infinite;
                color: #999;
            }
        }
        .loading-text {
            font-size: 30px;
            color: #999;
        }
    }
`;
